home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / plugin / nsIPlugin.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  8KB  |  208 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIPlugin.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIPlugin_h__
  6. #define __gen_nsIPlugin_h__
  7.  
  8.  
  9. #ifndef __gen_nsIFactory_h__
  10. #include "nsIFactory.h"
  11. #endif
  12.  
  13. #ifndef __gen_nspluginroot_h__
  14. #include "nspluginroot.h"
  15. #endif
  16.  
  17. /* For IDL files that don't want to include root IDL files. */
  18. #ifndef NS_NO_VTABLE
  19. #define NS_NO_VTABLE
  20. #endif
  21. #include "nsplugindefs.h"
  22. // {ffc63200-cf09-11d2-a5a0-bc8f7ad21dfc}
  23. #define NS_PLUGIN_CID \
  24. { 0xffc63200, 0xcf09, 0x11d2, { 0xa5, 0xa0, 0xbc, 0x8f, 0x7a, 0xd2, 0x1d, 0xfc } }
  25. // Prefix for ContractID of all plugins
  26. #define NS_INLINE_PLUGIN_CONTRACTID_PREFIX "@mozilla.org/inline-plugin/"
  27.  
  28. /* starting interface:    nsIPlugin */
  29. #define NS_IPLUGIN_IID_STR "df773070-0199-11d2-815b-006008119d7a"
  30.  
  31. #define NS_IPLUGIN_IID \
  32.   {0xdf773070, 0x0199, 0x11d2, \
  33.     { 0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a }}
  34.  
  35. /**
  36.  * The nsIPlugin interface is the minimum interface plugin developers need to 
  37.  * support in order to implement a plugin. The plugin manager may QueryInterface 
  38.  * for more specific plugin types, e.g. nsILiveConnectPlugin.
  39.  *
  40.  * The old NPP_New plugin operation is now subsumed by two operations:
  41.  *
  42.  * CreateInstance -- called once, after the plugin instance is created. This 
  43.  * method is used to initialize the new plugin instance (although the actual
  44.  * plugin instance object will be created by the plugin manager).
  45.  *
  46.  * nsIPluginInstance::Start -- called when the plugin instance is to be
  47.  * started. This happens in two circumstances: (1) after the plugin instance
  48.  * is first initialized, and (2) after a plugin instance is returned to
  49.  * (e.g. by going back in the window history) after previously being stopped
  50.  * by the Stop method. 
  51.  */
  52. class NS_NO_VTABLE nsIPlugin : public nsIFactory {
  53.  public: 
  54.  
  55.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPLUGIN_IID)
  56.  
  57.   /**
  58.      * Creates a new plugin instance, based on a MIME type. This
  59.      * allows different impelementations to be created depending on
  60.      * the specified MIME type.
  61.      */
  62.   /* void createPluginInstance (in nsISupports aOuter, in nsIIDRef aIID, in string aPluginMIMEType, [iid_is (aIID), retval] out nsQIResult aResult); */
  63.   NS_IMETHOD CreatePluginInstance(nsISupports *aOuter, const nsIID & aIID, const char *aPluginMIMEType, void * *aResult) = 0;
  64.  
  65.   /**
  66.      * Initializes the plugin and will be called before any new instances are
  67.    * created. It is passed browserInterfaces on which QueryInterface
  68.    * may be used to obtain an nsIPluginManager, and other interfaces.
  69.    *
  70.    * @param browserInterfaces - an object that allows access to other browser
  71.    * interfaces via QueryInterface
  72.    * @result - NS_OK if this operation was successful
  73.      */
  74.   /* void initialize (); */
  75.   NS_IMETHOD Initialize(void) = 0;
  76.  
  77.   /**
  78.      * Called when the browser is done with the plugin factory, or when
  79.      * the plugin is disabled by the user.
  80.      *
  81.      * (Corresponds to NPP_Shutdown.)
  82.    *
  83.    * @result - NS_OK if this operation was successful
  84.      */
  85.   /* void shutdown (); */
  86.   NS_IMETHOD Shutdown(void) = 0;
  87.  
  88.   /**
  89.      * Returns the MIME description for the plugin. The MIME description 
  90.      * is a colon-separated string containg the plugin MIME type, plugin
  91.      * data file extension, and plugin name, e.g.:
  92.      *
  93.      * "application/x-simple-plugin:smp:Simple LiveConnect Sample Plug-in"
  94.      *
  95.      * (Corresponds to NPP_GetMIMEDescription.)
  96.      *
  97.    * @param aMIMEDescription - the resulting MIME description 
  98.    * @result                 - NS_OK if this operation was successful
  99.      */
  100.   /* void getMIMEDescription (out constCharPtr aMIMEDescription); */
  101.   NS_IMETHOD GetMIMEDescription(const char * *aMIMEDescription) = 0;
  102.  
  103.   /**
  104.    * Returns the value of a variable associated with the plugin.
  105.      *
  106.    * (Corresponds to NPP_GetValue.)
  107.      *
  108.    * @param aVariable - the plugin variable to get
  109.    * @param aValue    - the address of where to store the resulting value
  110.    * @result          - NS_OK if this operation was successful
  111.      */
  112.   /* void getValue (in nsPluginVariable aVariable, in voidPtr aValue); */
  113.   NS_IMETHOD GetValue(nsPluginVariable aVariable, void * aValue) = 0;
  114.  
  115. };
  116.  
  117. /* Use this macro when declaring classes that implement this interface. */
  118. #define NS_DECL_NSIPLUGIN \
  119.   NS_IMETHOD CreatePluginInstance(nsISupports *aOuter, const nsIID & aIID, const char *aPluginMIMEType, void * *aResult); \
  120.   NS_IMETHOD Initialize(void); \
  121.   NS_IMETHOD Shutdown(void); \
  122.   NS_IMETHOD GetMIMEDescription(const char * *aMIMEDescription); \
  123.   NS_IMETHOD GetValue(nsPluginVariable aVariable, void * aValue); 
  124.  
  125. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  126. #define NS_FORWARD_NSIPLUGIN(_to) \
  127.   NS_IMETHOD CreatePluginInstance(nsISupports *aOuter, const nsIID & aIID, const char *aPluginMIMEType, void * *aResult) { return _to CreatePluginInstance(aOuter, aIID, aPluginMIMEType, aResult); } \
  128.   NS_IMETHOD Initialize(void) { return _to Initialize(); } \
  129.   NS_IMETHOD Shutdown(void) { return _to Shutdown(); } \
  130.   NS_IMETHOD GetMIMEDescription(const char * *aMIMEDescription) { return _to GetMIMEDescription(aMIMEDescription); } \
  131.   NS_IMETHOD GetValue(nsPluginVariable aVariable, void * aValue) { return _to GetValue(aVariable, aValue); } 
  132.  
  133. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  134. #define NS_FORWARD_SAFE_NSIPLUGIN(_to) \
  135.   NS_IMETHOD CreatePluginInstance(nsISupports *aOuter, const nsIID & aIID, const char *aPluginMIMEType, void * *aResult) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreatePluginInstance(aOuter, aIID, aPluginMIMEType, aResult); } \
  136.   NS_IMETHOD Initialize(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Initialize(); } \
  137.   NS_IMETHOD Shutdown(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Shutdown(); } \
  138.   NS_IMETHOD GetMIMEDescription(const char * *aMIMEDescription) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMIMEDescription(aMIMEDescription); } \
  139.   NS_IMETHOD GetValue(nsPluginVariable aVariable, void * aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValue(aVariable, aValue); } 
  140.  
  141. #if 0
  142. /* Use the code below as a template for the implementation class for this interface. */
  143.  
  144. /* Header file */
  145. class nsPlugin : public nsIPlugin
  146. {
  147. public:
  148.   NS_DECL_ISUPPORTS
  149.   NS_DECL_NSIPLUGIN
  150.  
  151.   nsPlugin();
  152.  
  153. private:
  154.   ~nsPlugin();
  155.  
  156. protected:
  157.   /* additional members */
  158. };
  159.  
  160. /* Implementation file */
  161. NS_IMPL_ISUPPORTS1(nsPlugin, nsIPlugin)
  162.  
  163. nsPlugin::nsPlugin()
  164. {
  165.   /* member initializers and constructor code */
  166. }
  167.  
  168. nsPlugin::~nsPlugin()
  169. {
  170.   /* destructor code */
  171. }
  172.  
  173. /* void createPluginInstance (in nsISupports aOuter, in nsIIDRef aIID, in string aPluginMIMEType, [iid_is (aIID), retval] out nsQIResult aResult); */
  174. NS_IMETHODIMP nsPlugin::CreatePluginInstance(nsISupports *aOuter, const nsIID & aIID, const char *aPluginMIMEType, void * *aResult)
  175. {
  176.     return NS_ERROR_NOT_IMPLEMENTED;
  177. }
  178.  
  179. /* void initialize (); */
  180. NS_IMETHODIMP nsPlugin::Initialize()
  181. {
  182.     return NS_ERROR_NOT_IMPLEMENTED;
  183. }
  184.  
  185. /* void shutdown (); */
  186. NS_IMETHODIMP nsPlugin::Shutdown()
  187. {
  188.     return NS_ERROR_NOT_IMPLEMENTED;
  189. }
  190.  
  191. /* void getMIMEDescription (out constCharPtr aMIMEDescription); */
  192. NS_IMETHODIMP nsPlugin::GetMIMEDescription(const char * *aMIMEDescription)
  193. {
  194.     return NS_ERROR_NOT_IMPLEMENTED;
  195. }
  196.  
  197. /* void getValue (in nsPluginVariable aVariable, in voidPtr aValue); */
  198. NS_IMETHODIMP nsPlugin::GetValue(nsPluginVariable aVariable, void * aValue)
  199. {
  200.     return NS_ERROR_NOT_IMPLEMENTED;
  201. }
  202.  
  203. /* End of implementation class template. */
  204. #endif
  205.  
  206.  
  207. #endif /* __gen_nsIPlugin_h__ */
  208.